using System;

namespace ServiceConsumer
{
    public class ActionDisposable : IDisposable
    {
        private readonly Action _stop;

        public ActionDisposable(Action start, Action stop)
        {
            _stop = stop;
            start();
        }

        public void Dispose()
        {
            _stop();
        }
    }
}